import { post } from '@/utils/request'

// 获取用户信息
// nnew
export const getUserInfo = p => post(`/service-upms/b/user/v1/currentInfo`, p, 'get')

// 获取用户下的租户
// new
export const queryTenantsByUserId = p => post(`/service-upms/b/user/v1/queryTenantsByUserId`, p, 'get')

// 获取所有用户分页
export const getPageList = p => post(`/service-upms/b/user/v1/pageList`, p)

// 获取所有用户列表
export const getList = p => post(`/service-upms/b/user/v1/selectList`, p)

// 添加用户
export const addUser = p => post(`/service-upms/b/user/v1/add`, p)

// 修改用户
export const modifyUser = p => post(`/service-upms/b/user/v1/modify`, p)

// 通过用户ID获取信息
export const getUserById = p => post(`/service-upms/b/user/v1/view/${p}`, {}, 'get')

// 修改用户状态
export const updateState = p => post(`/service-upms/b/user/v1/changeStatus/${p.id}/${p.status}`, {}, 'get')
// 修改用户离职状态
// 修改用户状态
export const updateJobState = p => post(`/service-upms/b/user/v1/quit/${p.id}`, {}, 'get')

// 删除用户ID
export const delUser = p => post(`/service-upms/b/user/v1/del/${p.id}`, {}, 'get')

// 重置密码
export const resetPwd = p => post(`/service-upms/b/user/v1/resetPwd/${p.id}`, {}, 'get')

// 用户修改密码
export const modifyPwd = p => post(`/service-upms/b/user/v1/modifyPwd`, p)

// 修改个人信心
export const modifySelf = p => post(`/service-upms/b/user/v1/modifySelf`, p)

// 用户注销
export const logout = p => post(`/service-upms/b/user/v1/logout/${p.id}`, {}, 'get')

// 用户关联角色
export const modifyByUserId = p => post(`/service-upms/b/userRole/v1/modifyByUserId`, p)

// 查询用户拥有的角色ID
export const getRolesByUserId = p => post(`/service-upms/b/user/v1/queryRoleIdsByUserId/${p}`, p, 'get')
